﻿#include<iostream>
#include<vector>


class person
{
public:
	person(std::string name, int age)
	{
		this->m_Name = name;
		this->m_Age = age;
	}

	std::string m_Name;
	int m_Age;
};



//存放对象
void test01()
{
	std::vector<std::vector<person>> v;
	
	std::vector<person> v1;
	std::vector<person> v2;

	person p1("aaa", 10);
	person p2("bbb", 20);
	person p3("ccc", 30);
	person p4("ddd", 40);
	person p5("eee", 50);
	person p6("fff", 60);

	v1.push_back(p1);
	v1.push_back(p2);
	v1.push_back(p3);
	
	v2.push_back(p4);
	v2.push_back(p5);
	v2.push_back(p6);

	//将v1,v2 放入大容器v中
	v.push_back(v1);
	v.push_back(v2);

	for (std::vector<std::vector<person>>::iterator it = v.begin(); it != v.end(); ++it)
	{
		for (std::vector<person>::iterator vit = (*it).begin(); vit != (*it).end(); ++vit)
		{
            std::cout << "姓名：" << (*vit).m_Name << "\t年龄：" << (*vit).m_Age << '\n';
		}
		std::cout << "----------------------------" << '\n';
	}
}


int main()
{
	test01();

	return 0;
}

